All Questions
14 questions
-1votes
1answer
107views
How can I prevent an object from being re-sanitized everytime it is passed as input to a function?
Suppose that I have a class named CharStream Additionally, there are a large number of functions which convert their function input into a CharStream def funky_the_function(_input): input = ...
0votes
2answers
933views
Best pattern/practice to execute a multi-step code generation process
I am working on a project that generates an API with the possibility of doing CRUD operations based on a high-level description of the resources that the user would like to have in an application. In ...
0votes
1answer
671views
Source of "... against the interface, not the implementation"
For a paper I am writing, I need to find the origin of the following two phrases: Code against the interface, not the implementation and Test the interface, not the implementation (Note: the ...
1vote
1answer
822views
Is it bad practice to run different versions of code in different environments? (i.e. test, prod)
As an example, let's say you have the following pseudocode: if test environment: # meaning you don't have the typical service account prod perms sudo as service account + do operation else: # in ...
3votes
1answer
176views
Is good or bad practice to share reporting modules between systems/apps?
At my new work, a few people want to share modules between systems/apps, and I'm a bit skeptical about it. Context: we have a lot of little apps living in different servers, some of them are ...
0votes
1answer
2kviews
Best design pattern for Notification System => How to handle multiple languages and items
As always I came here to ask for some light in a design issue I am facing. I have a system that issues some notifications : PackageReceivedNotification PackageSentNotification ...
-3votes
1answer
3kviews
Best practices: Number of return statements [duplicate]
I'd like to ask about best practices on return statements. So, what would be more preferable, something like... ... String r = null; if(var != null) { r = "NOT NULL!"; } return r; Or something ...
0votes
1answer
121views
MV(X) Patterns: How much nesting is too much? Is not enough?
Posts may be smaller than they appear! Skip the bulleted list. Lemme Just Say... I know that this is going to be largely (entirely...) opinion-based. Everyone has their own approach, and their own ...
3votes
0answers
88views
Should my application call statsd directly or should I call statsd based off logs?
I'm planning on incrementing counters in statsd based of various events within my application. I have logging in place for these events. So, from my viewpoint I have two options: Update the ...
0votes
1answer
1kviews
Why use the Singleton pattern over class functions and fields? [duplicate]
I'm going to start by saying that I understand that programming in mostly class functions and variables can be harmful to object-orientation, and that most of the time an instance is preferred. I'll ...
0votes
1answer
83views
How to record/store edits?
In many programs and web apps (stack exchange included) the program is able to backtrack what edits where made to the piece. My issue is similar: I want to be able to store a "timeline" of edits, ...
9votes
2answers
3kviews
Returning an IQueryable from an IRepository
Using the Repository pattern, is it proper to return an IQueryable of a data set (table), for generic usage? It is very handy in many cases, especially when using external libraries that leverage ...
8votes
2answers
324views
Low coupling processing big quantities of data
Usually I achieve low coupling by creating classes that exchange lists, sets, and maps between them. Now I am developing a Java batch application and I can't put all the data inside a data structure ...
18votes
4answers
6kviews
Should injecting dependencies be done in the ctor or per method?
Consider: public class CtorInjectionExample { public CtorInjectionExample(ISomeRepository SomeRepositoryIn, IOtherRepository OtherRepositoryIn) { this._someRepository = ...